<?php
require_once('SOAP/Client.php');
$cparams =& JComponentHelper::getParams('com_media');
$app = JFactory::getApplication();
$templateDir = JURI::base() . 'templates/' . $app->getTemplate(); 


$soapClient = new SoapClient("http://beta.nganluong.vn/micro_checkout_api.php?wsdl");
   
     
      
        // Setup the RemoteFunction parameters
        $params = "<params> 
  <receiver>anhcuongtv@gmail.com</receiver> 
  <language>vn</language> 
  <order_code>123456</order_code> 
  <return_url>http://sandbox.nganluong.vn/demo/update_order.php</return_url> 
  <cancel_url>http://sandbox.nganluong.vn/demo/cancel_order.php</cancel_url> 
</params>"; 
        $ap_param = array(
                    'merchant_site_code '     =>    22079,
        			'params' => $params,
        			'checksum' => '123455645'
        			);
                   
        // Call RemoteFunction ()
        $error = 0;
        try {
            $info = $soapClient->__call("SetExpressCheckoutDeposit", $ap_param);
        } catch (SoapFault $fault) {
            $error = 1;
            print("
            alert('Sorry, blah returned the following ERROR: ".$fault->faultcode."-".$fault->faultstring.". We will now take you back to our home page.');
            window.location = 'main.php';
            ");
        }
       
        if ($error == 0) {       
            $auth_num = $info->RemoteFunctionResult;
           
            if ($auth_num < 0) {

                // Setup the OtherRemoteFunction() parameters
                $at_param = array(
                            'amount'        => $irow['total_price'],
                            'description'    => $description);
           
                // Call OtherRemoteFunction()
                $trans = $soapClient->__call("OtherRemoteFunction", array($at_param));
                $trans_result = $trans->OtherRemoteFunctionResult;

                } else {
                    // Record the transaction error in the database
               
                // Kill the link to Soap
                unset($soapClient);
            }
        }
 


?>
<link rel="stylesheet" type="text/css" href="<?php echo $templateDir; ?>/css/vita_subpages.css" media="screen" />
<div class="content">
                        <div class="innerContent"> 
                            <h2><span><span>Tham Gia</span></span></h2>
                            <div class="fckDefault">
                              <a href="vita.html" title="Trở về Trang Vita" class="lnkReturn"><img src="<?php echo $templateDir; ?>/images/vita/dummy.gif" alt="Return to Vita" class="uiIcon initIcon-09"/><span>Trở về Trang Vita</span></a> <br/>
                              <div id="infoBlock">Vui lòng sử dụng mẫu đơn giản của email này để đăng ký và cùng nhau khám phá cộng đồng học tập và tận hưởng lợi ích mà nó mang lại cho các bạn</div>
                              <table class="contentForm">
                                <tr>
                                  <th>Thông tin thành viên</th>
                                </tr>

                                <tr>
                                	<td>
                                		<table class="paymentForm">
                                			<tr>
                                				<td>
                                					Tên đăng nhập: 
                                				</td>
                                				<td>
                                					<input type='text' size="35" class="redBorder"/>
                                				</td>
                                			</tr>
                                			
                                			<tr>
                                				<td>
                                					Mật khẩu: 
                                				</td>
                                				<td>
                                					<input type='text' size="35" class="redBorder"/>
                                				</td>
                                			</tr>
                                			
                                			<tr>
                                				<td>
                                					Xác nhận mật khẩu: 
                                				</td>
                                				<td>
                                					<input type='text' size="35" class="redBorder"/>
                                				</td>
                                			</tr>
                                			
                                			<tr>
                                				<td>
                                					Email: 
                                				</td>
                                				<td>
                                					<input type='text' size="35" class="redBorder"/>
                                				</td>
                                			</tr>
                                			
                                			<tr>
                                				<td>
                                					Ngày sinh: 
                                				</td>
                                				<td>
                                				
                                					<select id="dob_day" name="day" class="redBorder">
                                						<option>Day</option>
                                					</select>
                                					<select id="dob_month" name="month" class="redBorder">
                                						<option>Month</option>
                                					</select>
                                					<select id="dob_year" name="year" class="redBorder">
                                						<option>Year</option>
                                					</select>
                                				</td>
                                			</tr>
                                	
                                			<tr>
                                				<td>Giới tính:</td>
                                				<td>
                                					<input type="radio" value="1" id="radioMale" name="gender" checked/> Nam
                                					<input type="radio" value="1" id="radioFemale" name="gender" /> Nữ
                                				</td>
                                			</tr>
                                			
                                			<tr>
                                				<td colspan="2"><input type="checkbox" value="" id="termsbox" name="terms" />		
                                				I have read and understood the Terms and Conditions</td>
                                			</tr>
                                		</table>
                                	</td>
                                </tr>
                                
                                <tr>
                                	<td class="sendForm"><input id="submit" name="submit" type="submit" value="Tiếp Tục" /></td>
                                </tr>
                              </table>
                              <img src="http://nganluong.vn/data/images/buttons/8.gif" id="btn_payment"> 
<script src="http://data.nganluong.vn/javascripts/nganluong.apps.mcflow.js" 
language="javascript"></script> 
<script language="javascript"> 
var mc_flow = new NGANLUONG.apps.MCFlow({trigger:'btn_payment',url:'URL'});</script> 
                            </div>
                        </div>
                </div> 
